//package cn.sunjinxin.trade.application.work.node;
//
//import cn.sunjinxin.savior.core.helper.SpringHelper;
//import cn.sunjinxin.trade.application.work.pipeline.PreOrderValidateWorkHandler;
//import cn.sunjinxin.trade.application.work.pipeline.PreOrderValidateWorkHandlerContext;
//import cn.sunjinxin.trade.client.api.request.OrderCreateRequest;
//import cn.sunjinxin.trade.client.api.request.OrderValidateRequest;
//import cn.sunjinxin.trade.infrastructure.external.PayRpcService;
//
///**
// * @author issavior
// */
//public class PayValidateNode implements PreOrderValidateWorkHandler {
//
//    @Override
//    public void validate(OrderValidateRequest request, PreOrderValidateWorkHandlerContext validateWorkHandlerContext) {
//
//        validateWorkHandlerContext.validate(request);
//    }
//
//    @Override
//    public void validate(OrderCreateRequest request, PreOrderValidateWorkHandlerContext validateWorkHandlerContext) {
//        if ("TP".equals(request.getOrderType())) {
//
//            PayRpcService bean = SpringHelper.getBean(PayRpcService.class);
//            Boolean check = bean.check();
//            if (!check) {
//                throw new RuntimeException("支付余额不足");
//            }
//        }
//
//        // 购买资格校验,调治理服务获取白名单
//        validateWorkHandlerContext.validate(request);
//
//    }
//}
